﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace nextGeneration_app
{
    public partial class createpassword : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            username.Text = (String)(Session["username"]);
            string newPassword = newpasstxb.Text;
            string confirmPass = confirmtxb.Text;

            if (newPassword != confirmPass)
            {
                messagelbl.Text = "do not match!";
            }
            else
            {
                messagelbl.Text = "Match";
            }


        }

        protected void Button1_Click(object sender, EventArgs e)
        {

        }

        protected void confirmtxb_TextChanged(object sender, EventArgs e)
        {

        }

        protected void newpasstxb_TextChanged(object sender, EventArgs e)
        {
            string username = (String)(Session["userLoginName"]);    
            string userPassword=(String)(Session["userLoginPassword"]);
            string confirm = confirmtxb.Text;
            string userTypes = teacher_dbManager.checkTypeOfUser(username, userPassword);

            if (userTypes == "TEACHER")
            {
                teacher_dbManager.teacherforgotPassword(confirm,username);
                Response.Redirect("teacherlogin.aspx");              

            }



        }
    }
}